<script type="importmap">
    {
      "imports": {
        "acroml": "/js/acroml/src/index.mjs",
        "acroml_2": "/js/acroml/dist/esm/acroml.mjs",
        "acroml_3": "/js/acroml/dist/esm/min/acroml.mjs"
      }
    }
</script>
<script type="module">
    import AcroML from "acroml";
    console.log(AcroML);
    AcroML.Engine.onSwitchLanguage=function(){
        //window.location.reload();
        console.log(AcroML.Engine.instance.LCID);
        AcroML.htmlTranslator.translatePage(AcroML.Engine.instance.dd,AcroML.Engine.instance.LCID);
    }
    function start(){
        AcroML.buildHTMLSelector($('#languageSelector'));
        AcroML.Engine.onSwitchLanguage();
    }
    //jquery的$()函数不能加asycn函数
    document.onready=async function(){
        //dom构建后，如何同步获取构建dd，画面不闪烁?
        //console.log(AcroML.Engine);
        // let ddFile='/dd/Unicode.csv.txt';
        //let ddFile='/dd/Unicode.lng';
        //let ddFile='/dd/Unicode.plaintable.json';
        let ddFile='/dd/Unicode.treegrid.json';
        console.log('build dd...',ddFile);
        await AcroML.Engine.init({engineClass:AcroML.BrowserEngine,ddFile:ddFile});
        start();
    }
</script>